package com.tansun.easycare.rule.bakproject.service;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import com.tansun.easycare.rule.common.service.SpringInstanceUtils;
import com.tansun.easycare.rule.exception.BizException;

public class RuleBakTableConst {
	
	
    
	public  static  List<String>  readRuleTable() throws IOException {
		 InputStream is = SpringInstanceUtils.instance.getResource("classpath:ruletables.txt").getInputStream();
		 BufferedReader br= null;
		 InputStreamReader reader = null;
		 try {
			reader = new InputStreamReader( is  );
		    br = new BufferedReader(reader); 
            List<String>  list  = new  ArrayList<String>(); 
            String line = br.readLine();  
            while (line != null) {  
            	list.add(line);
                line = br.readLine();  
            }  
            return   list;
		} catch (Exception e) {
			throw  new  BizException(e,"E-005001");
		}finally {
			try {
				if (br != null) {
					br.close();
				}
				if (is != null) {
					is.close();
				}
				if (reader != null) {
					reader.close();
				}
			}catch(Exception e) {
				
			}
		}
		 
	}

}
